package com.security.demo.dao;

import com.security.demo.entity.BtModule;
import org.apache.ibatis.annotations.*;


import java.util.List;
@Mapper
public interface BtModuleDao {
    //添加
    @Insert("insert into bt_module(MODULE_NAME,MODULE_OPERATION_NAME) values(#{name},#{operationName})")
    public int insertBtModule(BtModule btModule);
    //删除
    @Delete("delete from bt_module where MODULE_NAME = #{name} and MODULE_OPERATION_NAME = #{operationName}")
    public int deleteBtModule(BtModule btModule);
    //修改，没有太大意义
    //public int updateBtModule(BtModule btModule);
    //查询
    @Select("select * from bt_module where MODULE_NAME = #{name}")
    @Results(value = {
            @Result(column = "AUTO_ID",property = "id"),
            @Result(column = "MODULE_NAME",property = "name"),
            @Result(column = "MODULE_OPERATION_NAME",property = "operationName")
    })
    @ResultType(value = BtModule.class)
    public List<BtModule> searchBtModule(BtModule btModule);
}
